package org.trade.coupon.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.trade.common.api.ICouponApi;
import org.trade.common.protocol.coupon.ChangeCoponStatusReq;
import org.trade.common.protocol.coupon.ChangeCoponStatusRes;
import org.trade.common.protocol.coupon.QueryCouponReq;
import org.trade.common.protocol.coupon.QueryCouponRes;
import org.trade.coupon.service.ICouponService;


@Controller
public class CouponApiImpl implements ICouponApi{

	@Autowired 	
	private ICouponService couponService;
     
	@RequestMapping(value="/queryCoupon",method=RequestMethod.POST)
	@ResponseBody
	public QueryCouponRes queryCoupon(@RequestBody QueryCouponReq queryCouponReq) {
		return couponService.queryCoupon(queryCouponReq);
	}
	@RequestMapping(value="/changeCoponStatus",method=RequestMethod.POST)
	@ResponseBody
	public ChangeCoponStatusRes changeCoponStatus(@RequestBody ChangeCoponStatusReq changeCoponStatusReq) {
		return couponService.changeCoponStatus(changeCoponStatusReq);
	}

}
